package com.hehao.kurunner.common;


import com.avos.avoscloud.AVOSCloud;
import com.avos.avoscloud.AVObject;
import com.avos.avoscloud.AVUser;

/**
 * @author HeHao
 * @time 2015/11/13 10:57
 * @email 139940512@qq.com
 */
public class BaseApplication extends com.hehao.hehaolibrary.common.BaseApplication {

    private static BaseApplication app ;

    @Override
    public void onCreate() {
        super.onCreate();
        app = this;

        //初始化leanCloud
        String appId = "KcemJWufFbUY32AxQNzrrcoU";
        String appKey = "i6qKMgLGOoPo7Yme4IgitePk";
        AVOSCloud.initialize(this, appId, appKey);

    }

    /**
     * 判断用户是否登录
     * @return  是：返回一个AVUser对象，否则：返回null
     */
    public AVUser isLogin(){
        AVUser currentUser = new AVUser();
        if(currentUser != null)
            return currentUser;
        else
            return null;
    }

    public static BaseApplication getApp(){
        return app;
    }
}
